package cn.ike.web;

import cn.ike.domain.company.Company;
import cn.ike.service.company.CompanyService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApplyController {

    // 注入dubbo服务接口的代理对象
    @Reference
    private CompanyService companyService;

    @RequestMapping("/apply-add")
    public String apply(Company company){
        try {
            // 远程调用企业管理服务
            companyService.save(company);
            return "1";
        } catch (Exception e){
            e.printStackTrace();
            return "0";
        }
    }

}
